//
//  MZAniView.m
//  MZAnimationDemo
//
//  Created by Chris Yang on 2016/11/25.
//  Copyright © 2016年 Chris Yang. All rights reserved.
//

#import "MZAniBar.h"
#import "MZAniShowView.h"
#import "UIView+MZLayout.h"

#import "MZAniView.h"

@implementation MZAniView

- (id)init {
    
    self = [super init];
    
    if (self) {
        [self configSelf];
        [self allocSubviews];
        [self configSubviews];
        [self positionSubviews];
    }
    
    return self;
}

- (void)configSelf {
    [self setBackgroundColor:[UIColor whiteColor]];
}

- (void)allocSubviews {
    _aniBar = [[MZAniBar alloc] init];
    _showView = [[MZAniShowView alloc] init];
}

- (void)configSubviews {
    
    /* Show View */
    
    /* Ani Bar */
    
    [self addSubview:_aniBar];
    [self addSubview:_showView];
}

- (void)positionSubviews {
    
    CGRect tmpRect = CGRectZero;
    
    /* Ani Bar */
    tmpRect = [self mzCenterRectInSubviewWithWidth:self.bounds.size.width height:150 toBottom:0];
    [_aniBar setFrame:tmpRect];
    
    /* Show View */
    tmpRect = self.bounds;
    tmpRect.size.height -= _aniBar.bounds.size.height;
    [_showView setFrame:tmpRect];
}

- (void)layoutSubviews {
    [self positionSubviews];
}

#pragma mark - Target-Action Pair

- (void)buttonClicked:(UIButton *)button {
    

}

#pragma mark - MISC

#pragma mark - User Interface

@end
